home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1998 August: Tool Chest / Dev.CD Aug 98 TC.toast / Tool Chest / Testing & Debugging / Mac OS Development Toolkit / Automation Essentials 2.3.0 / Host Automation Folder / LaunchQuit Engine / LQAssist.vu < prev    next >
Encoding:
Text File  |  1998-03-19  |  3.6 KB  |  119 lines  |  [TEXT/MPS ]

  1. #########################################################################
  2. #########################################################################
  3. ##                     Copyright © Apple Computer, Inc. 1994-1997
  4. ##                                All rights reserved
  5. #########################################################################
  6. #########################################################################
  7. #    
  8. #    Library:        LQAssist.vu
  9. #        
  10. #    Version:        2.1.4
  11. #    Description:    This Virtual User script is useful to LaunchQuit test
  12. #                    case developers and to those making changes to the
  13. #                    Launchquit engine itself. If this script is running,
  14. #                    the LaunchQuit Script will store its Target information
  15. #                    by sending a message to LQAssist. The next time 
  16. #                    the LaunchQuit Script is executed, it tries to restore
  17. #                    its target information by asking LQAssist for the 
  18. #                    stored list. This cuts the time to gather target
  19. #                    information from a minute to a few seconds!
  20. #                    
  21. #                    It is important to keep in mind that LQAssist must not
  22. #                    be used when running tests on real projects, since the 
  23. #                    Target's settings may vary and LQAssist does not update 
  24. #                    such changes. Use LQAssist only for development, then 
  25. #                    stop LQAssist before starting your "real" run.
  26. #                    
  27. #                    
  28. #                    LQAssist setup:
  29. #                     1.    Set your Host and Target environment as usual.
  30. #                        Make sure the AEPost external tool exists on
  31. #                        the Host.
  32. #                     2.    Create a new User (row) with the Target and
  33. #                        LaunchQuit Script selected, just like normal.
  34. #                     2.    Create another new User (row) with no Target and
  35. #                        LQAssist.vu as the script.
  36. #                     4.    Run the virtual user for LQAssist.vu
  37. #                     5. When the string:'LQAssist: waiting for msg: {  }'
  38. #                        is displayed on LQAssist's notebook you are ready.
  39. #                     6. Run your Target's script as many times as you like
  40. #                        and enjoy the time saved.
  41. #                    
  42. #                    In the future, it may do other things...
  43. #                    
  44. #                    NOTE: This feature requires the AEPost external tool.
  45. #    
  46. #    Contains:
  47. #        script LQAssist()
  48. #        
  49. #    History:
  50. #        Date:        By:        Changes:
  51. #        08/01/95    SBR        Created
  52. #        08/13/95    SBR        Added to LQ Project
  53. #        09/27/96    BRL        Added SPEC Exception handling
  54. #        01/21/97    SBR        Updated header.
  55. #########################################################################
  56. #########################################################################
  57. Libraries 
  58.     "AEPost.vuLib", 
  59.     "ExceptionHandling.lib";
  60.  
  61. script LQAssist ( )
  62. begin
  63.     ActorName("LQAssist");
  64.     tStoredTargetInfo := {};
  65.     InitMessages();
  66.  
  67.     while true
  68.     begin
  69.         tMsg := {};
  70.         println "LQAssist: waiting for msg: {tMsg}";
  71.         
  72.         tMsg := ReceiveMessage( {'LQAssist'}, {}, false, true, 30000 );
  73.         # tMsg := { 0, { {'tLQScriptID'}, g_Target_Info_ } }
  74.         # or, tMsg := { 0, { {'tLQScriptID'}, {'restore'} } }
  75.         
  76.         if tMsg[1]
  77.         begin
  78.             println "LQAssist: error receiving msg: {tMsg}";
  79.             
  80.             if tMsg[1] <> -7        # Simple timeout
  81.             begin
  82.                 global __gAEPostPresent := undefined;
  83.                 InitMessages();
  84.             end;
  85.  
  86.             tMsg := {};
  87.         end;
  88.         else
  89.         begin
  90.             tMsg := tMsg[2];
  91.         end;
  92.         
  93.         if tMsg
  94.         begin
  95.             tLQScriptID := tMsg[1];
  96.             if tMsg[2] = { 'restore' }
  97.             begin
  98.                 SendMessage( tLQScriptID, {'LQAssist'}, tStoredTargetInfo, false, 30000 );
  99.             end;
  100.             else
  101.             begin
  102.                 tStoredTargetInfo := tMsg[2];
  103.                 
  104.                 println "LQAssist: FRESH NEW TARGET INFO at {_Match([time])}!!";
  105.  
  106.                 tMsg := {};
  107.             end;
  108.         end;        
  109.     end;
  110. end;
  111.  
  112.  
  113. #    AEPost primitives:
  114. #        ReceiveMessage( pReceiverID, pSenderID, pReceiveMultiple, pDeleteMailbox := true, 
  115. #                        pWaitForMessage := 0 )
  116. #    
  117. #        SendMessage( pReceiverID, pSenderID, pMessage, pCreateReplyMailbox := false, 
  118. #                        pWaitForSend := 0, pWaitForReceipt := 0, pWaitForReply := 0 );
  119.